<?php
namespace Depart\Model;
// use Common\Model\BaseModel;
use Think\Model;
use Think\Model\RelationModel;
/**
 * 权限规则model
 */
class DwgModel extends RelationModel{
	
	protected $tableName='dwg';
	protected $fields = array(
            'id', 'dwgcode', 'dwgname', 'date', 
            // _pk 表示主键字段名称 
            '_pk' => 'id',
            
            );
	protected $_link=array(
			'users'=>array(
				'mapping_type'=>self::BELONGS_TO,
				'foreign_key'=>'designer',
				'mapping_fields'=>'realname',
				'as_fields'=>'realname:dname',
				),
			'type'=>array(
				'mapping_type'=>self::BELONGS_TO,
				'foreign_key'=>'type',
				'mapping_fields'=>'title',
				'as_fields'=>'title:hv',
				),
		) ;
}

?>